﻿using System.ComponentModel.DataAnnotations.Schema;
using Entity.Models;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Entity.Mapping
{
    public class ConfiguracaoMap : EntityTypeConfiguration<Configuracao>
    {
        public ConfiguracaoMap()
        {
            //Chave Primaria
            this.HasKey(t => t.Id);

            //Propriedades
            this.Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.Property(t => t.CaminhoRelatorio)
                .HasMaxLength(255);
            this.Property(t => t.StringConexao)
                .HasMaxLength(255);

            //Mapeamento tabela coluna
            this.ToTable("Configuracao", "Config");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.CaminhoRelatorio).HasColumnName("CaminhoRelatorio");
            this.Property(t => t.StringConexao).HasColumnName("StringConexao");
        }
    }
}
